package com.qingcloud.base.constant;


import java.time.format.DateTimeFormatter;

/**
 * 常量定义处
 */
public interface WamingConstant {


    /**
     * 请求成功返回码
     */
    Integer SUCCESS = 2000;
    /**
     * 需要确认提示返回码
     */
    Integer CONFIRM_CODE = 2001;
    /**
     * 未登录返回码
     */
    Integer NOT_LOGIN = 6000;
    /**
     * 请求失败返回码
     */
    Integer FAILURE = 3000;
    /**
     * 请求验证失败返回码
     */
    Integer PART_SUCCESS = 4000;
    String DEFAULT_PWD = "Aqi123456";
    String ADMIN_USER_NAME = "admin";
    Integer ZERO = 0;
    Integer ONE = 1;
    Integer TWO = 2;
    Integer THREE = 3;
    Integer FOUR = 4;

    //完整时间格式化
    DateTimeFormatter NORMAL_FULL_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    /**
     * 1室内蛙鸣MQTT
     */
    Integer PROTOCOL_CODE_MQTT = 1;
    /**
     * 2室内漂爱协议
     */
    Integer PROTOCOL_CODE_PA = 2;
    /**
     * 3网格化TCP/IP)
     */
    Integer PROTOCOL_CODE_WT = 3;

    String STATTIME = "00:00";

    String ENDTIME = "23:59";

    String MONDAY = "1";
    String TUESDAY = "2";
    String WEDNESDAY = "3";
    String THURSDAY = "4";
    String FRIDAY = "5";
    String SATURDAY = "6";
    String SUNDAY = "7";
    String CONTEXT_PATH = "/backend/file/view/";
    /**
     * 正常状态
     * 正常状态
     */
    String STATION_STATION_NORMAL = "变为正常";
    /**
     * 保持不变
     */
    String STATION_UNCHANGED = "保持不变";

    /**
     * 接收平台TCP协议
     */
    String TCP_QUERY_COMMAND = "/command/tcp/cd/queryCmdA";//查询指令
    String TCP_BASE_COMMAND = "/command/tcp/cd/queryCmdC";//基础指令查询
    String TCP_SET_COMMAND = "/command/tcp/cd/setCommand";//参数设置指令
    String TCP_BATCH_BASE_COMMAND = "/command/tcp/cd/batchBaseCommand";//基础指令查询
    String TCP_BATCH_SET_COMMAND = "/command/tcp/cd/batchSetCommand";//批量设置参数指令
    String TCP_BATCH_QUERY_COMMAND = "/command/tcp/cd/batchQueryCommand";//批量查询参数指令
    String TCP_UPGRADE_COMMAND = "/command/tcp/cd/upgradeCommand";//批量升级参数指令

    String URL_ROBOT_PROJECT_INFO = "/command/robot/bz/getProjectInfo";
    String URL_ROBOT_OPEN_ROBOT_WEBSOCKET = "/command/robot/bz/openRobotWebsocket";

    public static final String LICENCE = "b83242d76fc043dcacba7a33917ba6f3";

    public static final String COMMON_KEY = "common_key";
    public static final String COMMON_VALUE = "common_value";

    //文件浏览url前缀
    public static final String FILE_VIEW_PREFIX = "/backendApi/file/view/";
    //文件浏览url前缀
    public static final String FILE_FRAME_PREFIX = "/backendApi/file/frame/";

    //数据库删除标识字段
    public static final String DELETE_FLAG_NORMAL = "0";
    public static final String DELETE_FLAG_DELETE = "1";

    public static final String MQTT_PROTOCOL_VERSION_1 = "1.0";
    public static final String MQTT_PROTOCOL_VERSION_2 = "2.0.0";
    public static final String MQTT_PROTOCOL_PRODUCT_KEY = "product01";
    /**
     * 故障类型
     */
    public static final Integer DICTIONARYTYPE_FAULT_TYPE = Integer.valueOf(33);
    /**
     * 事件类型
     */
    public static final Integer DICTIONARYTYPE_EVENT_TYPE = Integer.valueOf(34);

    /**
     * 复位原因类型
     */
    public static final Integer DICTIONARYTYPE_RESET_TYPE01 = Integer.valueOf(56);
    public static final Integer DICTIONARYTYPE_RESET_TYPE02 = Integer.valueOf(57);

    //事件日志-事件
    public static final Integer EVENT_LOG_EVENT = 34;
    //事件日志-故障
    public static final Integer EVENT_LOG_FAULT = 33;
    //事件日志-重启
    public static final Integer EVENT_LOG_RESET = 56;

    //邮箱的正则表达式
    public static final String MAILPATTERN="^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$";

    //中国大陆手机号的正则表达式
    public static final String PHONEPATTERN="^1[0-9]{10}$";


    ////////////////////////////////////shiro 认证//////////////////////////
    /** 登录用户Shiro权限缓存KEY前缀 */
    public static String PREFIX_USER_SHIRO_CACHE  = "shiro:cache:";

    /** 登录用户Token令牌缓存KEY前缀 */
    public static final String PREFIX_USER_TOKEN  = "user_token_%s";
    /** Token缓存时间：3600秒即一小时 */
    public static final int  TOKEN_EXPIRE_TIME  = 10*60;

    public final static String X_ACCESS_TOKEN = "X-Access-Token";
    public final static String X_SIGN = "X-Sign";
    public final static String X_TIMESTAMP = "X-TIMESTAMP";
    public final static String TOKEN_IS_INVALID_MSG = "Token失效，请重新登录!";


    public static final String jessionId="shiro:sessionId";
    public static final String SESSION_USER = "shiro:sessionUser";
    ////////////////////////////////////  shiro 认证结束/////////////////////



}
